package psd;

import psd.RegRecord.LookKinkHow;

public class WU {

	static boolean parseYesNo( String s ) {
		s = s.toLowerCase();
		if ( s.startsWith("y") || s.startsWith("t") ) {
			return true;
		} else if ( s.startsWith("n") || s.startsWith("f" ) ) {
			return false;
		}

		throw new RuntimeException( "Bad string: " + s );
	}
	
	static String yesBlank(boolean val) {
		return (val) ? "yes" : "";
	}



	static String yesNo(boolean val) {
		return (val) ? "yes" : "no";
	}

	
	static String yesNoBlank(int val) {
		switch ( val ) {
		case Matcher.YES: return "yes";
		case Matcher.NO: return "no";
		case Matcher.UNKNOWN: return "";
		default: throw new RuntimeException( "Illegal value for yesNoBlank: " + val );
		}
	}



	public static String writeLookKink(LookKinkHow lookKink) {
		if ( lookKink == LookKinkHow.NONE ) {
			return "no";
		} else if ( lookKink == LookKinkHow.ONLY ) {
			return "only";
		} else if ( lookKink == LookKinkHow.EITHER ){
			return "either";
		} else {
			return "";
		}
	}
	
}
